<template>
  <div style="padding-bottom:60px">
    <c-list ref="form" :model="formData" :rules="formRules" :column="2" label-width="120px">
      <c-list-item v-if="type==='1'||type===1||type==='applyAudit'" prop="resultCode" label="审核结果">
        <el-select v-model="formData.resultCode" placeholder="审核结果" style="width:100%" clearable>
          <el-option label="同意" :value="1" />
          <el-option label="不同意" :value="0" />
        </el-select>
      </c-list-item>
      <c-list-item :rules="[{ required: !formData.resultCode, message: '请输入审核意见', trigger: 'change' }]" prop="remarks" label="审核意见">
        <el-input v-model="formData.remarks" type="textarea" placeholder="审核意见" maxlength="1024" show-word-limit clearable />
      </c-list-item>
    </c-list>

  </div>
</template>
<script>
export default {
  name: 'OpinionEdit',
  props: {
    id: {
      type: String,
      default: ''
    },
    type: {
      type: [Number, String],
      default: '1'
    }
  },
  data() {
    return {
      saveLoading: false,
      formData: {
        id: null,
        remarks: '',
        resultCode: 1
      },
      formRules: {}
    }
  },
  created() {
  },
  methods: {
    async  getData() {
      if ((this.type === '2' || this.type === 2) && this.type !== 'applyAudit') return { ...this.formData, id: this.id }
      const pass = await this.$refs.form.validate()
      if (!pass) return
      return { ...this.formData, id: this.id }
    }
  }
}
</script>

